<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
            rel="stylesheet"
            type="text/css"
            media="screen"
            href="/static/pc/css/reset.css"
    />
    <link
            rel="stylesheet"
            type="text/css"
            media="screen"
            href="/static/pc/css/common.css"
    />
    <link
            rel="stylesheet"
            type="text/css"
            media="screen"
            href="/static/pc/css/main.css"
    />
</head>
<script
        type="text/javascript"
        src="http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"
></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.4/js/select2.min.js"></script>
<body>
<!-- -nav -->

<div class="nav-box">
    <div class="nav">
        <div class="left"><img src="/static/pc/images/logo.png" class="vm" /></div>
        <ul class="right ovh">
            <li class="left"><a href="{:url('index/main')}" style="color: #0C0C0C">首页</a></li>
            <li class="left"><a href="{:url('index/about')}" style="color: #0C0C0C">关于我们</a></li>
            <li class="left"><a href="{:url('index/insurant_index')}" style="color: #0C0C0C">保险公司使用</a></li>
            <li class="left"><a href="{:url('index/insurerIndex')}" style="color: #0C0C0C">物权人使用</a></li>
            {if(isset($user))}
            <li class="left">
                <a href="{:url('user/message')}" style="color: #0C0C0C"> <i class="iconfont">&#xe641;</i>消息</a>
            </li>

            <li class="left por">
                <a class="">{$user.username}<i class="iconfont">&#xe617;</i>
                    <div class="nav-sub-menu poa none">
                        <input type="hidden" value="{$user.role_id}" id="role_id">
                        <div id="user_info" >我的信息</div>
                        <div id="login_out" >退出登录</div>
                    </div>
                </a>
            </li>
            <script>
                $('#user_info').click(function () {
                    var role_id = $('#role_id').val();
                    if(role_id == 3){
                        window.location.href='/pc/user/user_info';
                    }else{
                        window.location.href='/pc/user/insurer_info';
                    }
                });
                $('#login_out').click(function () {
                    window.location.href='/pc/login/login_out';
                });
            </script>
            <li class="left">
                {if($user.role_id == 1)}
                <a href="{:url('insurer/step1')}" style="color: #0C0C0C">保险人员</a>
                {/if}
                {if($user.role_id == 3)}
                <a href="{:url('insurant/check_data',['menu_id'=>1])}" style="color: #0C0C0C">物权人</a>
                {/if}
            </li>
            {else/}
            <li class="left"><a class="login" href="{:url('login/login')}" style="color: #0C0C0C">登录</a></li>
            <li class="left"><a  href="{:url('login/register')}" style="color: #0C0C0C">注册</a></li>
            {/if}
        </ul>
    </div>
</div>
<script>
    $('.nav>ul>li>a').hover(function () {
        if ( !! $(this).children('div.nav-sub-menu')) {
            console.log($(this));
            console.log('12');
            // $(this).css('borderBottom','none')
            $(this).find('div.nav-sub-menu').show();
        }
    }, function () {
        $(this).find('div.nav-sub-menu').hide();
    });
</script>